package com.cyou.dream.configuration;

import com.cyou.dream.factory.YamlPropertySourceFactory;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.util.List;

/**
 * 风控配置文件实体
 * <p>
 * 初始的风控配置在resources目录下的risk-strategies.yml文件中，通过{@link YamlPropertySourceFactory}进行加载。
 */
@Configuration
@ConfigurationProperties(prefix = "risk-control")
@PropertySource(value = "classpath:risk-strategies.yml", factory = YamlPropertySourceFactory.class)
@Data
public class RiskConfig {

    /**
     * 配置文件版本
     */
    private Integer version;

    /**
     * 策略列表
     */
    private List<StrategyConfig> strategies;

}
